package cn.sccdlg.ssm.dao;

import cn.sccdlg.ssm.domain.Traveller;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author RaoShuang
 * @emil 991207823@qq.com
 * @date 2020/10/27 21:20
 * 旅客持久层
 */
@Repository
@Mapper
public interface ITravellerDao {

    /**
     * 根据会员id查询旅客信息
     * @param ordersId 会员id
     */
    @Select("SELECT * FROM traveller WHERE id IN (SELECT travellerId FROM order_traveller WHERE orderId=#{ordersId})")
    List<Traveller> findByOrdersId(String ordersId) throws Exception;
}
